namespace Roids.SL
{
    using Framework;
    using Microsoft.Xna.Framework;

    public class Blast : SceneItem
    {
        private const double Decay = 1;
        private const int Speed = 300;

        private double _life;

        public Blast(Game game) : base(game)
        {
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            _life -= Decay*gameTime.ElapsedGameTime.TotalSeconds;

            ReadyToRemove = (_life <= 0);
        }

        public void Fire(Vector2 vector, Vector2 origin)
        {
            Velocity = Vector2.Normalize(vector)*Speed;
            _life = 2;
            Position = origin;
        }
    }
}